<template>
	<view>
		<view class="main">
      <Home v-if="tabName === 0"></Home>
    </view>
    <!--tab-->
    <u-tabbar
        :value="tabName"
        @change="name => tabName = name"
        :fixed="true"
        :placeholder="true"
        :safeAreaInsetBottom="true"
    >
      <u-tabbar-item text="首页" icon="home" value="home"></u-tabbar-item>
      <u-tabbar-item text="物料" icon="photo" ></u-tabbar-item>
      <u-tabbar-item text="我的" icon="account" ></u-tabbar-item>
    </u-tabbar>
	</view>
</template>

<script>
  import Home from './home/index.vue'
	export default {
    components: {
      Home
    },
		data() {
			return {
				tabName: 0,
        tabComponent: {
          home: Home,
          material: 'material',
          mine: 'mine'
        }
			}
		},
		methods: {
      toLogin(){
        uni.navigateTo({
          url: '/pages/login/index'
        })
      }
		}
	}
</script>

<style>
	.main {
    padding: 10px;
  }
</style>
